Skip to content

Enable LibraryImportGenerator.Tests on BSD/SunOS#129185

Merged
janvorli merged 7 commits into
dotnet:mainfrom
am11:patch-46
Jun 15, 2026
Merged

Enable LibraryImportGenerator.Tests on BSD/SunOS#129185
janvorli merged 7 commits into
dotnet:mainfrom
am11:patch-46

Conversation

@am11

@am11 am11 commented Jun 9, 2026

Copy link
Copy Markdown
Member

These should be fine with bootstrap test build. We need to set TOOLCHAIN instead of triplet so DNNE proj gets target-triplet set by convention.

@am11 am11 added community-contribution Indicates that the PR has been added by a community member arch-arm32 os-freebsd FreeBSD OS arch-x64 os-SunOS SunOS, currently not officially supported os-openbsd OpenBSD OS, currently not officially supported labels Jun 9, 2026
@am11

am11 commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

Upstream PR dotnet/arcade#16995.

cc @Thefrank, @sethjackson

@Thefrank

Copy link
Copy Markdown
Contributor

short: fine but maybe move the freebsd12 to 14 or 15? or the current version the docker image uses?


long:
Not a compiler engineer so I am not 100% how it impacts the build but LLVM can actually use major.minor for FreeBSD. ABI and symbol versioning?

From my FreeBSD 15.0:
$ cc --version

FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)
Target: x86_64-unknown-freebsd15.0
Thread model: posix
InstalledDir: /usr/bin

cmake manual (4.3.3) still shows using triple so I am not sure why this would start failing now
(https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-using-clang)

but if it works, then it works 🤷

@am11
am11 requested a review from MichalStrehovsky as a code owner June 10, 2026 02:48
@am11

am11 commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

CMAKE_C_COMPILER_TARGET will set the value of --target https://github.com/Kitware/CMake/blob/04c87b945ca15ae5c4e7f75df6a38543616219b7/Modules/CMakeDetermineCCompiler.cmake#L95.

The error we were getting was different: dotnet/arcade#16995 (comment) emerging from

<Exec Command="cmake -P &quot;$(RepositoryEngineeringDir)/native/output-toolchain-info.cmake&quot;"
EchoOff="true"
ConsoleToMsBuild="true"
StandardOutputImportance="Low"
EnvironmentVariables="TARGET_BUILD_ARCH=$(TargetArchitecture)">
<Output TaskParameter="ConsoleOutput" PropertyName="CrossTargetXml" />
</Exec>
<XmlPeek XmlContent="$(CrossTargetXml)" Query="toolchain-info/target-triple/text()">
<Output TaskParameter="Result" PropertyName="TargetTriple" />
</XmlPeek>
<XmlPeek XmlContent="$(CrossTargetXml)" Query="toolchain-info/linker-args/text()">
<Output TaskParameter="Result" PropertyName="DnneLinkerUserFlags" />
</XmlPeek>
<XmlPeek XmlContent="$(CrossTargetXml)" Query="toolchain-info/compiler-args/text()">
<Output TaskParameter="Result" PropertyName="DnneCompilerUserFlags" />
</XmlPeek>
<PropertyGroup>
<CommonToolchainArgs>--target=$(TargetTriple) --sysroot=$(ROOTFS_DIR)</CommonToolchainArgs>
because the value of TOOLCHAIN was null. Note that TOOLCHAIN is our own variable in this context.

maybe move the freebsd12 to 14 or 15?

Updated. 👍 Mostly it's backwards compatible but if it gets too old, then it ends. up using fallback/shim code on newer platform (#if __FreeBSD_version types of checks affect degraded impl for "old" binaries in newer kernel code).

@am11

am11 commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

Timeout failures are unrelated.

@sethjackson

sethjackson commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Any chance this can get merged soon? Without TOOLCHAIN fixes the cross build fails for OpenBSD with some subsets.

@janvorli

Copy link
Copy Markdown
Member

/ba-g the build timeouts are unrelated to this change and are happening on multiple PRs.

@janvorli
janvorli merged commit 0989174 into dotnet:main Jun 15, 2026
165 of 171 checks passed
@am11
am11 deleted the patch-46 branch June 16, 2026 00:26
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 17, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
These should be fine with bootstrap test build. We need to set TOOLCHAIN
instead of triplet so DNNE proj gets target-triplet set by convention.

---------

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-arm32 arch-x64 area-Infrastructure-libraries community-contribution Indicates that the PR has been added by a community member os-freebsd FreeBSD OS os-openbsd OpenBSD OS, currently not officially supported os-SunOS SunOS, currently not officially supported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants